<?php

namespace App\Admin\Controllers;

use App\Http\Controllers\Controller;
use App\Models\AdminUser;
use Dcat\Admin\Admin;
use Dcat\Admin\Layout\Content;

class HomeController extends Controller
{
    public function index(Content $content)
    {
        $admin_user = AdminUser::find(Admin::user()->id);
        if (!$admin_user->isSuperManger()) {
            return redirect(admin_route('department.file.uploader'));
        }
        return redirect(admin_route('department.index'));
    }
}
